


<!DOCTYPE html>
<html id="htmlId">
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
  <title>Coverage Report > AUserServiceImpl</title>
  <style type="text/css">
    @import "../../css/coverage.css";
    @import "../../css/idea.min.css";
  </style>
  <script type="text/javascript" src="../../js/highlight.min.js"></script>
  <script type="text/javascript" src="../../js/highlightjs-line-numbers.min.js"></script>
</head>

<body>
<div class="content">
<div class="breadCrumbs">
Current scope:     <a href="../../index.html">all classes</a>
    <span class="separator">|</span>
    <a href="../index.html">com.ie.service.admin</a>
</div>

<h1>Coverage Summary for Class: AUserServiceImpl (com.ie.service.admin)</h1>

<table class="coverageStats">

<tr>
  <th class="name">Class</th>
<th class="coverageStat 
">
  Method, %
</th>
<th class="coverageStat 
">
  Branch, %
</th>
<th class="coverageStat 
">
  Line, %
</th>
</tr>
<tr>
  <td class="name">AUserServiceImpl</td>
<td class="coverageStat">
  <span class="percent">
    50%
  </span>
  <span class="absValue">
    (1/2)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/4)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    5.9%
  </span>
  <span class="absValue">
    (1/17)
  </span>
</td>
</tr>
  <tr>
    <td class="name">AUserServiceImpl$$SpringCGLIB$$0</td>
  </tr>
<tr>
  <td class="name"><strong>Total</strong></td>
<td class="coverageStat">
  <span class="percent">
    50%
  </span>
  <span class="absValue">
    (1/2)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/4)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    5.9%
  </span>
  <span class="absValue">
    (1/17)
  </span>
</td>
</tr>
</table>

<br/>
<br/>


<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package com.ie.service.admin;
&nbsp;
&nbsp;import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
&nbsp;import com.ie.common.http.ResponseResult;
&nbsp;import com.ie.common.security.utils.ConfigrarionBean;
&nbsp;import com.ie.common.security.utils.JwtTokenUtil;
&nbsp;import com.ie.common.security.utils.RedisUtil;
&nbsp;import com.ie.entity.admin.AUserEntity;
&nbsp;import com.ie.mapper.admin.AUserMapper;
&nbsp;import org.springframework.beans.factory.annotation.Autowired;
&nbsp;import org.springframework.stereotype.Service;
&nbsp;
&nbsp;import java.util.*;
&nbsp;
&nbsp;@Service
<b class="fc">&nbsp;public class AUserServiceImpl extends ServiceImpl&lt;AUserMapper, AUserEntity&gt; implements AUserService {</b>
&nbsp;    @Autowired
&nbsp;    private JwtTokenUtil jwtTokenUtil;
&nbsp;    @Autowired
&nbsp;    private RedisUtil redisUtil;
&nbsp;    @Autowired
&nbsp;    private ConfigrarionBean config;
&nbsp;    // 对传入的对象参数进行比较
&nbsp;    // 1.有这个用户:a.密码正确;b.密码错误
&nbsp;    // 无此用户:返回
&nbsp;    // 2.密码正确:返回token,跳转到相应展示页面
&nbsp;    @Override
&nbsp;    public ResponseResult&lt;Map&lt;String, String&gt;&gt; login(AUserEntity aUserEntity) {
&nbsp;// 获取到这个参数
<b class="nc">&nbsp;        Long count = lambdaQuery().eq(AUserEntity::getAname, aUserEntity.getAname()).count();</b>
<b class="nc">&nbsp;        if (count == 0) {</b>
<b class="nc">&nbsp;            return ResponseResult.getMessageResult(null, &quot;A001&quot;);</b>
&nbsp;        }
<b class="nc">&nbsp;        HashMap&lt;String, String&gt; mapuser = new HashMap&lt;&gt;();</b>
<b class="nc">&nbsp;        mapuser.put(&quot;aname&quot;, aUserEntity.getAname());</b>
<b class="nc">&nbsp;        mapuser.put(&quot;apwd&quot;, aUserEntity.getApwd());</b>
<b class="nc">&nbsp;        List&lt;AUserEntity&gt; userlist = query().allEq(mapuser).list();</b>
<b class="nc">&nbsp;        if (userlist.size() &gt; 0) {</b>
<b class="nc">&nbsp;            String token = jwtTokenUtil.createToken(aUserEntity.getAname());</b>
<b class="nc">&nbsp;            redisUtil.set(&quot;login_&quot; + aUserEntity.getAname(), aUserEntity.getAname(), config.getRedisExpiration());</b>
&nbsp;            // 把生成的有效信息返回给ResponseResultl
<b class="nc">&nbsp;            HashMap&lt;String, String&gt; loginresult = new HashMap&lt;&gt;();</b>
<b class="nc">&nbsp;            loginresult.put(&quot;authtoken&quot;, token);</b>
<b class="nc">&nbsp;            loginresult.put(&quot;aname&quot;, aUserEntity.getAname());</b>
<b class="nc">&nbsp;            loginresult.put(&quot;aid&quot;, aUserEntity.getId() + &quot;&quot;);</b>
<b class="nc">&nbsp;            return ResponseResult.getSuccessResult(loginresult);</b>
&nbsp;        } else {
<b class="nc">&nbsp;            return ResponseResult.getMessageResult(null, &quot;A002&quot;);</b>
&nbsp;        }
&nbsp;    }
&nbsp;}
</code>
</pre>
</div>

<script type="text/javascript">
(function() {
    var msie = false, msie9 = false;
    /*@cc_on
      msie = true;
      @if (@_jscript_version >= 9)
        msie9 = true;
      @end
    @*/

    if (!msie || msie && msie9) {
      hljs.highlightAll()
      hljs.initLineNumbersOnLoad();
    }
})();
</script>

<div class="footer">
    
    <div style="float:right;">generated on 2025-06-15 18:23</div>
</div>
</body>
</html>
